<?php

use Illuminate\Http\Request;
use App\Model\Enterprise;


/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
// 个人
Route::prefix('admin')->namespace('Admin')->group(function () {
    Route::any('user/add', ['uses' => 'UserController@add']);
    Route::any('user/update',['uses' => 'UserController@update']);

});
//活动
Route::prefix('home')->namespace('Home')->group(function () {
    Route::any('activity/activityList', ['activity' => 'ActivityController@ActivityList']);
});

// Route::any('activity/activityList', 'Home\ActivityController@ActivityList');

//$api = app('Dingo\');
// 使用门面注册路由
APIRoute::version('v1',function($api){
    $api->group(['namespace'=>'App\Http\Controllers\Resume'],function($api){
        // 简历列表
        $api->get('resume','ResumeController@index');
        // 简历详情
        $api->get('resume/{id}','ResumeController@resumeDetails');
        // 点击创建简历按钮后生成用户基本信息简历
        $api->any('create','ResumeController@create');
        // 编辑简历“求职意向”信息
        $api->any('resume/editObjective/{id}','ResumeController@editResumeObjective');
        // 编辑简历“基本”信息
        $api->any('resume/editBasicInfo/{id}','ResumeController@editResumeBasicInfo');
        // 编辑简历“教育背景”信息
        $api->any('resume/editEducation/{id}','ResumeController@editResumeEducation');
        // 编辑简历“实习/工作经历”信息
        $api->any('resume/editInternships/{id}','ResumeController@editResumeInternships');
         // 编辑简历“实习/工作经历”信息
        $api->any('resume/editallResumeMsg/{id}','ResumeController@editallResumeMsg');
        
        // // 编辑简历“比赛奖项”信息
        // $api->get('resume/editCompetitions/{id}','ResumeController@editResumeCompetitions');
        // // 编辑简历“自我评价”信息
        // $api->get('resume/editSelfReview/{id}','ResumeController@editResumeSelfReview');
        // // 编辑简历“实践活动”信息
        // $api->get('resume/editPractice/{id}','ResumeController@editResumePractice');
        // // 编辑简历“实践活动”信息
        // $api->get('resume/editOther/{id}','ResumeController@editResumeOther');

        $api->get('industry','ResumeController@industry');
    });
});

// 用户信息查询
Route::any('user/sel', 'Admin\UserController@sel');
//用户总积分和积分日志查询
Route::any('user/integra', 'Admin\UserController@integra');
//用户修改信息 提交接口
Route::any('user/save', 'Admin\UserController@save');
//用户兑换记录表
Route::any('user/exchangelog', 'Admin\UserController@exchangelog');

//航运咨询
Route::namespace('Find')->group(function () {
    //咨询列表
    Route::get('infomation/infomationList', 'InfomationController@InfomationList');
    //咨询详情
    Route::get('infomation/infomationDesc', 'InfomationController@InfomationDesc');
    //咨询分类查询
    Route::get('infomation/infoType', 'InfomationController@InfoType');
});
//我的收藏
Route::namespace('Myself')->group(function () {
    Route::get('collect/enterprise', 'CollectController@CollectList');
});
//注册接口
Route::post('register', 'Auth\RegisterController@register');
//登录接口
//Route::post('login', 'Auth\LoginController@login');
Route::post('logout', 'Auth\LoginController@logout');
//需要认证的接口
Route::group(['middleware' => 'auth:api'], function() {

});



//平台活动  专家讲堂  模块
Route::group(['namespace'=>'Campaign\Platform','prex'=>'active'],function(){
    // 查询所有的  活动列表
    Route::any('active/selall','ActiveController@Activeshow');
    //活动详情
    Route::any('active/selone','ActiveController@ActiveOne');
    //添加报名人
    Route::any('active/apply','ActiveController@AddApply');

    //专家讲堂  专家讲堂列表
    Route::any('experts/selall','ExpertController@ExpertsAll');
    //专家讲堂  专家详情
    Route::any('experts/selone','ExpertController@ExpertsOne');

    //给专家的评论  添加评论  视频
    Route::any('comment/commentadd','CommentController@CommentAdd');

    //查找视频
    Route::any('comment/commentsel','CommentController@CommentSel');

    //添加公司  企业的评价
    Route::any('comment/commentadd','CommentController@CommentAdd');

    //添加专家
    Route::any('experts/add','ExpertController@ExpertAdd');

    //上传图片
    Route::any('experts/imgadd','ExpertController@FileAdd');
    Route::any('experts/img','ExpertController@ExpertImg');

    Route::any('aaa','RegController@aaa');

    //注册
    Route::any('reg/send','RegController@Sendcode');
    Route::any('reg/add','RegController@RegUser');
    Route::any('reg/forget','RegController@ForgetPwd');

});


//微信授权
Route::group(['namespace'=>'Login','prefix'=>'login/'],function (){
    //获取openid
    Route::get('openid','LoginController@openid');

});

//热门行业
Route::group(['namespace'=>'Industry','prefix'=>'industry/industry/'],function (){
    //行业展示
    Route::get('sel','IndustryController@sel');
    //行业添加
    Route::post('add','IndustryController@add');
    //行业删除
    Route::get('del','IndustryController@del');
});
//企业中心
Route::group(['namespace'=>'Enterprise','prefix'=>'enterprise/'],function (){
    //简历管理  全部列表
    Route::get('resumelists', 'ResumeController@ResumeLists');
    //简历管理  带筛选列表
    Route::get('resumelist', 'ResumeController@ResumeList');
    //简历管理  被拒绝的简历
    Route::get('resumenolist', 'ResumeController@ResumeNolist');
    //简历管理  拒绝
    Route::post('resumedels', 'ResumeController@ResumeDels');
    //简历管理  邀约
    Route::post('inviteadd', 'ResumeController@InviteAdd');
    //简历管理  职位筛选列表
    Route::get('positions', 'ResumeController@PositionList');
    //简历管理  学校筛选列表
    Route::get('schoollist', 'ResumeController@SchoolList');
    //简历管理  专业筛选列表
    Route::get('majorlist', 'ResumeController@MajorList');
    //我的职位  列表
    Route::get('positionlist', 'PositionController@PositionList');
    //我的职位  删除
    Route::get('positiondel', 'PositionController@PositionDel');
    //我的职位  修改状态
    Route::get('positionstatus', 'PositionController@PositionStatus');
    //我的职位  查询单一数据
    Route::get('positionone', 'PositionController@PositionOne');
    //我的职位  添加数据
    Route::post('positionadd', 'PositionController@PositionAdd');
    //我的职位  修改数据
    Route::any('positionupd', 'PositionController@PositionUpd');
    //职位列表
    Route::get('positionshow', 'PositionController@PositionShow');
    //企业展示
    Route::any('selone', 'EnterpriseController@sel');
    //企业添加
    Route::any('add', 'EnterpriseController@add');
    //热门企业
    Route::get('selall','EnterpriseController@selall');
    //企业排序
    Route::get('order','EnterpriseController@order');
    //修改企业资料
    Route::post('save','EnterpriseController@save');
    //文件上传
    Route::any('upload','EnterpriseController@uploadImg');
    //视频上传
    Route::any('uploadVideo','EnterpriseController@uploadVideo');
});

//航运会务
Route::group(['namespace' =>'ConferenceServices','prefix'=>"conferenceServices/conferenceServices/"], function () {
    //航运会务展示
    Route::get('sel', 'ConferenceServicesController@sel');
});

//轮播图
Route::group(['namespace' =>'Banners','prefix'=>"banners/banners/"], function () {
    //轮播图展示
    Route::get('sel', 'BannersController@sel');
    Route::post('aaa', 'BannersController@aaa');
    Route::get('bbb', 'BannersController@bbb');
});

//动态
Route::group(['namespace' =>'Trends','prefix'=>"trends/trends/"], function () {
    //动态展示展示
    Route::get('sel', 'TrendsController@sel');

    Route::post('addimg', 'TrendsController@addImg');
    Route::post('add', 'TrendsController@add');
    Route::get('bbb', 'TrendsController@bbb');
});

//模块
Route::group(['namespace' =>'Modules','prefix'=>"modules/modules/"], function () {
    //模块展示
    Route::get('sel', 'ModulesController@sel');
});

//测试
Route::group(['namespace' =>'Testti','prefix'=>"testti/testti/"], function () {
    //测试展示
    Route::get('sel', 'TesttiController@sel');
    Route::get('selone', 'TesttiController@selOne');
});

//测试
Route::group(['namespace' =>'Titles','prefix'=>"titles/titles/"], function () {
    //测试展示
    Route::get('sel', 'TitlesController@sel');
});

//测试计入
Route::group(['namespace' =>'TextRecord','prefix'=>"textrecord/textrecord/"], function () {
    //测试计入添加
    Route::get('add', 'TextRecordController@add');
    Route::get('CheckOneByIDandChetype', 'TextRecordController@CheckOneByIDandChetype');
});

//登入、注册、验证码、忘记密码
Route::group(['namespace' =>'Usermanagement','prefix'=>"usermanagement/usermanagement/"], function () {
    //测试计入添加
    Route::get('add', 'UsermanagementController@add');
    //用户登入
    Route::post('UserLogin', 'UsermanagementController@UserLogin');
    //TOKEN验证
    Route::get('CheckToken', 'UsermanagementController@CheckToken');


});

//企业登入
Route::group(['namespace' =>'EnterpriseAccount','prefix'=>"enterpriseaccount/enterpriseaccount/"], function () {
    //测试计入添加
    Route::post('checkLogin', 'EnterpriseAccountController@checkLogin');
});


